﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RSS.aspx.cs" Inherits="Paltop_v0._1.UI.RSS" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../Styles/RSS/RSS.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/JQueryUI/facebox.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/JQuery/jquery-1.6.4.min.js"></script>
    <script src="../Scripts/JQuery/facebox.js" type="text/javascript"></script>
    <title>RSS Feed</title>
</head>
<body>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#addFeedButton").click(function () { addFeed(); });
            $("#addContentLink").click(function () { $("#addNewFeed").toggle(); $("#addnewFeedMessage").text("Type The Rss Feed Adrress Here"); });
            $(".RSSItems").click(function () { var fId = $(this).attr("id"); ShowFeed(fId); });
        });
        function addFeed() {
            var url = $("#FeedAddress").val();
            $.post("AjaxController.ashx", {
                URL: url,
                ACTION: "ADDFEED",
                ACTIONTYPE: "FEED"
            }, function (result) {
                $("#sendDataTimer").hide(500);
                if (result == "0") {
                    $("#addnewFeedMessage").text("Error");
                }
                else {

                    $("#treeViewUL").append(result);
                    $("#addnewFeedMessage").text("Type The RSS Feed Address Here");
                    $("#addNewFeed").hide();
                }

            });
        }
        function ShowFeed(id) {
            $.post("AjaxController.ashx", {
                id: id,
                ACTION: "GETFEED",
                ACTIONTYPE: "FEED"
            }, function (result) {
                $("#sendDataTimer").hide(500);
                if (result == "0") {

                }
                else {

                    $("#newsItems").html("");
                    $("#newsItems").append(result);
                }

            });
        }
        function addFeedMouseOver() {
            $("#addFeedButton img").attr("src", "../TemplateImages/RSS/addFeedHover.png");
        }
        function addFeedMouseOut() {
            $("#addFeedButton img").attr("src", "../TemplateImages/RSS/addFeed.png");
        }
    </script>
    <form id="form1" runat="server">
    <!-- This is gonna be a dirty code in one night -->
    <div id="mainContainer">
        <div id="top">
            <div class="Left">
                <a id="addContentLink" title="Add Feed" href="#"><span id="addContent">Add feed</span>
                </a><span id="readerAddress">www.paltop.com/reader</span>
                <div id="addNewFeed" style="background-color: rgba(47, 79, 79, .9); padding: 10px;
                    border-radius: 10px; display: none">
                    <p id="addnewFeedMessage">
                        Type The Rss Feed Address Here</p>
                    <input type="text" id="FeedAddress" />
                    <a id="addFeedButton" href="#" onclick="addFeed()" onmouseover="addFeedMouseOver()" onmouseout="addFeedMouseOut()">
                        <img src="../TemplateImages/RSS/addFeed.png" width="20px" height="20px" /></a>
                </div>
            </div>
            <div class="Right">
                <div id="pic">
                    <img src="../TemplateImages/donkey.png" /></div>
                <div id="username">
                    USERNAME</div>
                <div id="seperator">
                    |</div>
                <div id="signOut">
                    <a href="#">Sign out</a></div>
            </div>
        </div>
        <div id="subContainer">
            <div id="application">
                <div id="sidebarWrapper">
                    <div id="sidebar">
                        <div id="treeView">
                            <div id="treeViewHeader">
                                <span>Your feeds</span>
                            </div>
                            <ul id="treeViewUL">
                                <li class="RSSItems" style="font-weight: bold; font-size: 13px">All feeds</li>
                                <% Response.Write(list);%>
                            </ul>
                        </div>
                    </div>
                </div>
                <div id="feedContainer">
                    <div id="feedContainer-main">
                        <div id="feedContainer-main-Header">
                            <h3>
                                A look at what's new !</h3>
                        </div>
                        <div id="feedContainer-main-News">
                            <div id="inner">
                                <div id="innerContent">
                                    <ul id="newsItems">
                                        <li>
                                            <div class="Subject">
                                            
                                                <div class="SubjectControl">
                                                    Grave danger</div>
                                            </div>
                                            <div class="News_Content">
                                                <div class="ContentControl">
                                                    As a sample news the USA attacked iran.Everybody Run !</div>
                                            </div>
                                            <div class="Date">
                                                Feb 4 2012</div>
                                        </li>
                                        <li>
                                            <div class="Subject">
                                                <div class="SubjectControl">
                                                    Grave danger</div>
                                            </div>
                                            <div class="News_Content">
                                                <div class="ContentControl">
                                                    As a sample news the USA attacked iran.Everybody Run !</div>
                                            </div>
                                            <div class="Date">
                                                Feb 4 2012</div>
                                        </li>
                                        <li>
                                            <div class="Subject">
                                                <div class="SubjectControl">
                                                    Grave danger</div>
                                            </div>
                                            <div class="News_Content">
                                                <div class="ContentControl">
                                                    As a sample news the USA attacked iran.Everybody Run !</div>
                                            </div>
                                            <div class="Date">
                                                Feb 4 2012</div>
                                        </li>
                                        <li>
                                            <div class="Subject">
                                                <div class="SubjectControl">
                                                    Grave danger</div>
                                            </div>
                                            <div class="News_Content">
                                                <div class="ContentControl">
                                                    As a sample news the USA attacked iran.Everybody Run !</div>
                                            </div>
                                            <div class="Date">
                                                Feb 4 2012</div>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div id="feedContainer-main-footer">
                            <div id="buttons">
                                <asp:Button ID="previous" runat="server" Text="Previous" />
                                <asp:Button ID="next" runat="server" Text="Next" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="footer">
                Paltop RSS reader.</div>
        </div>
    </div>
    </form>
</body>
</html>
